<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<!-- Set render engine for 360 browser -->
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- HTML5 shim for IE8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->

<link
	href="/yxtcmf/public/simpleboot/themes/<?php echo C('SP_ADMIN_STYLE');?>/theme.min.css"
	rel="stylesheet">
<link href="/yxtcmf/public/simpleboot/css/simplebootadmin.css"
	rel="stylesheet">
<link href="/yxtcmf/public/js/artDialog/skins/default.css" rel="stylesheet" />
<link
	href="/yxtcmf/public/simpleboot/font-awesome/4.4.0/css/font-awesome.min.css"
	rel="stylesheet" type="text/css">
<style>
.length_3 {
	width: 180px;
}

form .input-order {
	margin-bottom: 0px;
	padding: 3px;
	width: 40px;
}

.table-actions {
	margin-top: 5px;
	margin-bottom: 5px;
	padding: 0px;
}

.table-list {
	margin-bottom: 0px;
}

.progress {
	overflow: hidden;
	height: 15px;
	margin-bottom: 5px;
	background-color: #f5f5f5;
	border-radius: 4px;
	-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar-success {
	background-color: #70d445;
}

.progress-bar {
	float: left;
	width: 0%;
	height: 100%;
	font-size: 12px;
	line-height: 20px;
	color: #fff;
	text-align: center;
	background-color: #46c37b;
	-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
	box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
	-webkit-transition: width 0.6s ease;
	-o-transition: width 0.6s ease;
	transition: width 0.6s ease;
}
</style>
<!--[if IE 7]>
	<link rel="stylesheet" href="/yxtcmf/public/simpleboot/font-awesome/4.4.0/css/font-awesome-ie7.min.css">
	<![endif]-->
<script type="text/javascript">
//全局变量
var GV = {
    DIMAUB: "/yxtcmf/",
    JS_ROOT: "public/js/",
    TOKEN: ""
};
</script>
<!-- Le javascript
    ================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="/yxtcmf/public/js/jquery.js"></script>
<script src="/yxtcmf/public/js/wind.js"></script>
<script src="/yxtcmf/public/simpleboot/bootstrap/js/bootstrap.min.js"></script>
<?php if(APP_DEBUG): ?><style>
#think_page_trace_open {
	z-index: 9999;
}
</style><?php endif; ?>
<body class="J_scroll_fixed">
<div class="wrap js-check-wrap">
  <form class="well form-search" method="post" action="<?php echo u('AdminShiti/shijuan');?>">
    <div class="search_type cc mb10">
      <div class="mb10"> 
        <span class="mr20">
            &nbsp; &nbsp;关键字：
        <input type="text" id="keyword" name="keyword" class="form-control" value="" placeholder="关键词">
        <input type="submit" class="btn" value="搜索"/>
        </span>
      </div>
    </div>
  </form>
    <?php $state=array("1"=>"已发布","0"=>"已关闭"); ?>
  <form class="js-ajax-form" action="" method="post">
      <table width="100%" class="table table-hover  table-list">
        <thead>
	          <tr>
	            <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
	            <th width="40">ID</th>
	            <th>试卷名称</th>
	            <th width="100">状态</th>
	            <th width="130">考试时间</th>
				<th width="160">添加时间</th>
				<th width="130">出题教师</th>
				<th width="120">操作</th>
	          </tr>
        </thead>
        	
        	<?php if(is_array($data)): foreach($data as $key=>$vo): ?><tr> 
		            <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="<?php echo ($vo["id"]); ?>"></td>
		            <td><a><?php echo ($vo["id"]); ?></a></td>
		            <td><span><?php echo ($vo["title"]); ?></span></td>
		            <td><?php echo ($state[$vo['state']]); ?></td>
					<td><?php echo ($vo["limitedtime"]); ?>分钟</td>
					<td><?php echo ($vo["addtime"]); ?></td>
					<td><?php echo (getusername($vo["teacherid"])); ?></td>
		            <td>
		                <div class="btn-group">
		                   <a  class="btn btn-default btn-sm" href="<?php echo u('Exam/shiti/paperspriew',array('id'=>$vo['id']));?>" target="_blank">预览</a>
                           <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                             <span class="caret"></span>
                             <span class="sr-only"></span>                             
                           </button>                          
                           <ul class="dropdown-menu pull-right" role="menu" >
						        <?php if($vo['state'] == 1): ?><li><a class="close-testpaper" id="<?php echo ($vo['id']); ?>" href="javascript:" title="关闭试卷"> 关闭试卷</a></li>
								<?php else: ?>
									<li><a class="open-testpaper" id="<?php echo ($vo['id']); ?>" href="javascript:" title="开启试卷"> 开启试卷</a></li><?php endif; ?>
						      <li><a href="javascript:open_iframe_dialog('<?php echo U('AdminShiti/renyuan',array('id'=>$vo['id']));?>','成绩单')">成绩单</a></li>
                              <li><a href="<?php echo u('AdminShiti/delshijuan',array('id'=>$vo['id']));?>" class="js-ajax-delete" data-subcheck="true" data-msg="你确定删除吗？">删除</a></li>
                           </ul>
                          </div>
					</td>
	          	</tr><?php endforeach; endif; ?>
          <thead>
	          <tr>
	            <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
	            <th width="40">ID</th>
	            <th>试卷名称</th>
	            <th width="100">状态</th>
	            <th width="130">考试时间</th>
				<th width="160">添加时间</th>
				<th width="130">出题教师</th>
				<th width="120">操作</th>
	          </tr>
        </thead>
          </table>
          <div class="pagination"><?php echo ($Page); ?></div>   
      <div class="form-actions">                       
        <button class="btn btn-primary js-ajax-submit" type="submit" data-action="<?php echo u('AdminShiti/delshijuan');?>">删除</button>
      </div>
  </form>
</div>
<script src="/yxtcmf/public/js/common.js"></script>
<script type="text/javascript"> 
$(".close-testpaper").click(function(){ 
   var id=$(this).attr('id');
   $.ajax({ url:'<?php echo u('Exam/Shiti/closetestpaper');?>', 
		 type:"post", data:{'id':id}, 
		 dataType:'json', 
		 success:function(data){
		   location.reload(); 
		   }
		}
	  );

}); 
$(".open-testpaper").click(function(){ 
   var id=$(this).attr('id');
   $.ajax({ url:'<?php echo u('Exam/Shiti/opentestpaper');?>', 
		 type:"post", data:{'id':id}, 
		 dataType:'json', 
		 success:function(data){
		   location.reload(); 
		   }
		}
	  );

}); 
</script>   
</body>
</html>